package conappfig

import (
	"github.com/spf13/viper"
	"log"
)

type Config struct {
	Mysql
	Redis
	Upload
	AutherName
}
type AutherName struct {
	SecretId   string
	SecretKeys string
}
type Mysql struct {
	User     string
	Host     string
	Port     int
	Password string
	DataBase string
}
type Redis struct {
	Host     string
	Port     int
	Password string
}
type Upload struct {
	AccessKey string
	SecretKey string
}

var ConappfigData Config

func Init() {
	viper.SetConfigFile("../house/conappfig/dev.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&ConappfigData)
	log.Println("Viper 连接成功", ConappfigData)
}
